"use strict";
{
    //声明类
    class Person {
        //方法
        //构造器
        constructor(name, age) {
            //为实例对象添加方法
            this.intros = () => { };
            this.name = name;
            this.age = age;
        }
        //声明一个方法, 在原型对象上添加方法
        intro() {
            console.log(`我叫 ${this.name} 今年 ${this.age}`);
        }
    }
    //程序员的类
    class Programmer extends Person {
        //构造器
        constructor(name, age, language) {
            super(name, age); // super 调用父类的构造方法
            this.language = language;
        }
        intro() {
            console.log(`我叫 ${this.name} ,今年 ${this.age}, 擅长 ${this.language}`);
        }
    }
    //实例化对象
    // let me = new Person('xiaohigh', 35);
    // //输出
    // console.log(me);
    // me.intro()
    //实例化 Programmer 类
    // let me = new Programmer('张三', 18, "JavaScript");
    // me.intro();
    //成员修饰符
    class Girl {
        constructor(name, age, weight) {
            this.name = name;
            this.age = age;
            this.weight = weight;
        }
        test2() {
            console.log(this.name); // √ 
            console.log(this.age); // √
            console.log(this.weight); // √
        }
    }
    class Child extends Girl {
        test() {
            console.log(this.name); // √ 
            console.log(this.age); // √
            // console.log(this.weight); // X
        }
    }
    let yanqiu = new Girl("艳秋", 28, 120);
    console.log(yanqiu.name); // √
    // console.log(yanqiu.age);  // X
    // console.log(yanqiu.weight); // X
}
